#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
事件定义模块

定义工作流中使用的各种事件类
"""

from typing import List
from llama_index.core.workflow.events import Event
from .data_structures import AnalysisContext, QueryResult
from .enums import QueryType


class ProblemClassifiedEvent(Event):
    """问题分类完成事件"""
    analysis_context: AnalysisContext


class MultiRoundAnalysisEvent(Event):
    """多轮分析事件"""
    analysis_context: AnalysisContext
    round_results: List[QueryResult]


class QueryExecutionEvent(Event):
    """查询执行事件"""
    analysis_context: AnalysisContext
    query_results: List[QueryResult]


class NextQueryRecommendationEvent(Event):
    """评估后推荐的下一查询事件"""
    analysis_context: AnalysisContext
    recommended_query_type: QueryType = None


class QueryExecutionPlanEvent(Event):
    """查询执行计划事件"""
    analysis_context: AnalysisContext
    planned_queries: List[QueryType]